<template>

    <div class="app" :style="contentArea" @lifecycle="lifecycle">

        <navbar class="page-navbar" :eeui="{backgroundColor:'#FFFFFF'}">
            <!-- <navbar-item type="back"></navbar-item> -->
            <navbar-item type="title">
                <text class="chinahandfont page-navbar-title">&#xe6a0;</text>
                <!-- <text class="chinahandfont page-navbar-title">&#xe698;</text> -->
            </navbar-item>
            <!-- <navbar-item type="right" @click="viewCode('component/tabbar')"> -->
                <!-- <icon content="md-code-working" class="iconr"></icon> -->
            <!-- <navbar-item type="right" @click="barRightButtonClick()">
                <text class="chinahandfont iconr">&#xe682;</text>
            </navbar-item> -->
        </navbar>

        <div class="page-content">
            <!-- <image src="https://eeui.app/assets/images/cartoon/m2.png" class="page-content-image"></image>
            <text class="content-text">页签里面可以放任何子组件，感谢你对eeui的支持</text> -->
            <div class="welcomeWrp">
              <text class="welcomeTxt">{{global.lang('欢迎')}}</text>
              <!-- <text class="welcomeTxt">Welcome to China</text> -->
            </div>
            <div class="codeWrp">
              <!-- <div class="scanWrp" @click="goWechatScan()"> -->
              <div class="scanWrp" @click="testss()">
                <text class="chinahandfont scanIcon">&#xe67d;</text>
                <text class="scanTxt">SCAN CODE</text>
              </div>
              <div class="qrWrp" @click="goWechatPayCode()">
                <text class="chinahandfont qrIcon">&#xe674;</text>
                <text class="qrTxt">PAYMENT CODE</text>
              </div>
            </div>
            <div class="funWrp">
              <div class="eleWrp" @click="goWechatWallet()">
                <text class="chinahandfont funIcon">&#xe67c;</text>
                <text class="funTxt">RMB Wallet</text>
              </div>

              <div class="eleWrp" @click="openBottomPopup()">
              <!-- <div class="eleWrp" @click="openOverlay()"> -->
              <!-- <div class="eleWrp" @click="barRightButtonClick()"> -->
                <text class="chinahandfont funIcon">&#xe69d;</text>
                <text class="funTxt">Call Center</text>
              </div>
              <!-- <div class="eleWrp" @click="goWechatBank()">
                <text class="chinahandfont funIcon">&#xe673;</text>
                <text class="funTxt">RMB Card</text>
              </div> -->
              
              <!-- <div class="eleWrp" @click="goSchedule()">
                <text class="chinahandfont funIcon">&#xe67f;</text>
                <text class="funTxt">Schedule</text>
              </div> -->
              <div class="eleWrp" @click="goWechat()">
                <text class="chinahandfont funIcon">&#xe69c;</text>
                <text class="funTxt">Chat</text>
              </div>
            </div>
            <div class="placeWrp"></div>
            <div class="box" :style="{'height': scrollHeight + 'px'}">
              <!-- @itemClick="itemClick" -->
              <scroll-view
                        ref="reflectName"
                        class="list"
                        :eeui="{
                                pullTips: true,
                            }"
                        @pullLoadListener="pullLoadListener"
                        @refreshListener="refreshListener">
                <div class="rcmWrp">
                  <text class="rcmTitle">Rcommend</text>
                  <wxc-ep-slider :slider-id="sliderId"
                      :card-length='cardLength'
                      :card-s="cardSize"
                      :select-index="0" 
                      ref="wxc-ep-slider"
                      @wxcEpSliderCurrentIndexSelected="wxcEpSliderCurrentIndexSelected">

                    <!--自动生成demo-->
                    <wxc-pan-item v-for="(v,index) in RecommondList"
                        :key="index"
                        :slot="`card${index}_${sliderId}`"
                        :class="['slider',`slider${index}`]"
                        @wxcPanItemPan="wxcPanItemPan"
                        @wxcPanItemClicked="wxcPanItemClicked(v)">
                        <!-- @click="goIntroduction(v.uid)" -->
                        <image class="sliderImg" :src="v.pictureUrl"></image>
                        <!-- <image class="sliderImg" src="./assets/Ganzi_Si_3.png"></image> -->
                      <text class="sliderTxt">{{v.title}}</text>
                      <!-- <text class="sliderTxt">XiZang{{index + 1}}</text> -->
                    </wxc-pan-item>
                    <!-- <div v-for="(v,index) in [1,2,3,4,5]"
                        :key="index"
                        :slot="`card${index}_${sliderId}`"
                        :class="['slider',`slider${index}`]">
                        <image class="sliderImg" src="./assets/Ganzi_Si_3.png"></image>
                      <text class="sliderTxt">XiZang{{index + 1}}</text>
                    </div> -->
                  </wxc-ep-slider>
                </div>
                <div class="placeWrp"></div>
                <div class="panel" v-for="num in lists"  @click="goIntroduction(num.uid)">
                    <div class="panel-item">
                        <!-- <text class="panel-text">{{num}}</text> -->
                        <div class="hImgWrp">
                          <image class="panImg" :src="num.pictureUrl"></image>
                          <!-- <image class="panImg" src="./assets/headIcon.png"></image> -->
                        </div>
                        <div class="scTxtWrp">
                          <div class="scTopWrp">
                            <!-- <text class="tpLeftTxt">{{num.title}}</text> -->
                            <text class="tpRightTxt">{{num.title}}</text>
                            <!-- <text class="tpLeftTxt">8 AUG 2019</text>
                            <text class="tpRightTxt">SPORTS&RECREATION</text> -->
                          </div>
                          <div class="scBtWrp">
                            <text class="btTxt">{{num.introduce}}</text>
                            <!-- <text class="btTxt">Misery By Moonlight:Shanghai Wild Animal Park Starts Late Night Tours.Misery By Moonlight:Shanghai Wild Animal Park Starts Late Night Tours.Misery By Moonlight:Shanghai Wild Animal Park Starts Late Night Tours.</text> -->
                          </div>
                        </div>
                    </div>
                </div>
              </scroll-view>
            </div>
            <!-- <div class="box">

              <scroll-view
                      ref="reflectName"
                      class="list"
                      :eeui="{
                              pullTips: true,
                          }"
                      @itemClick="itemClick"
                      @pullLoadListener="pullLoadListener"
                      @refreshListener="refreshListener">
                  <div class="panel" v-for="num in lists">
                      <div class="panel-item">
                          <text class="panel-text">{{num}}</text>
                      </div>
                  </div>
              </scroll-view>

            </div> -->
        </div>

        <wxc-popover ref="wxc-popover1"
            :buttons="btns"
            :textStyle="textStyle"
            :position="popoverPosition"
            :arrowPosition="popoverArrowPosition"
            @wxcPopoverButtonClicked="popoverButtonClicked"
        ></wxc-popover>

        <wxc-popup popup-color="#ffffff" class="popupLoc"
               :show="isBottomShow"
               @wxcPopupOverlayClicked="popupOverlayBottomClick"
               pos="bottom"
               height="319">
          <div class="popcontent">

            <text class="callHeaderTxt">Call the tour guide / customer service center！</text>

            <div class="callBtnWrp" @click="popoverBottomClicked('service2')">
              <text class="chinahandfont callBtnIcon">&#xe680;</text>
              <text class="callBtnTxt">Tourist guide</text>
            </div>

            <div class="callBtnWrp" @click="popoverBottomClicked('service1')">
              <text class="chinahandfont callBtnIcon">&#xe67b;</text>
              <text class="callBtnTxt">Customer service center</text>
            </div>
          </div>
        </wxc-popup>
        
        <!-- <div class="overlayWrp" :style="{height:contentHeight}" v-if="show" @click="wxcOverlayBodyClicked()">
          <div class="bgWrp"></div>
          <div class="callWrp" @click="">
            <div class="popcontent">

            <text class="callHeaderTxt">Call the tour guide / customer service center！</text>

            <div class="callBtnWrp" @click="popoverBottomClicked('service2')">
              <text class="chinahandfont callBtnIcon">&#xe680;</text>
              <text class="callBtnTxt">Tourist guide</text>
            </div>

            <div class="callBtnWrp" @click="popoverBottomClicked('service1')">
              <text class="chinahandfont callBtnIcon">&#xe67b;</text>
              <text class="callBtnTxt">Customer service center</text>
            </div>
          </div>
          </div>
        </div> -->

        <!-- <wxc-overlay
          :show="show"
          opacity="0.6"
          @wxcOverlayBodyClicked="wxcOverlayBodyClicked">
          <div class="callWrp">

          </div>
        </wxc-overlay> -->

    </div>

</template>

<style scoped>

    .box {
        width: 750px;
        /* height: 350px; */
        /* flex: 1 */
    }
    .list {
        width: 750px;
        flex: 1
    }
    .panel {
        width: 750px;
        height: 185px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .panel-item {
        width: 696px;
        height: 185px;
        /* background-color: #ff9e14; */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom-style: solid;
        border-bottom-width: 1px;
        border-bottom-color: #c7c7c7;
    }
    .panel-text {
        font-size: 50px;
        text-align: center;
    }

    .hImgWrp {
      width: 212px;
      height: 140px;
      border-radius: 10px;
	    /* background-color: #db1212 */
	    background-color: #d2d2d2
    }

    .panImg {
      width: 212px;
      height: 140px;
      border-radius: 10px;
	    /* background-color: #db1212 */
	    /* background-color: #d2d2d2 */
    }

    .scTxtWrp {
      width: 435px;
      height: 140px;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
    }
     
    .scTopWrp {
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
    }

    .scBtWrp {
      width: 435px;
    }
    
    .tpLeftTxt {
      font-size: 20px;
      color: #999999
    }

    .tpRightTxt {
      font-size: 20px;
	    color: #c8301c;
      margin-left: 16px;
    }

    .btTxt {
      font-size: 24px;
      color: #000000;
      text-overflow: ellipsis;
      lines: 4;
    }

    .chinahandfont {
        font-family: chinahandfont;
    }

    .app {
      /* padding-bottom: 188px; */
        /* flex: 1; */
        
        /* background-color: #ffffff; */
        /* background-color: #e90101; */
    }

    .iconr {
        /* width: 66px;
        height: 66px; */
        font-size: 33px;
        color: #000000;
        margin-right: 36px;
        /* background-color: #000000; */
        /* margin-top: 26px; */
    }

    .popupLoc {
      /* bottom: 200px; */
      /* margin-bottom: 500px; */
    }

    .popcontent {
      flex: 1;
      flex-direction: column;
      justify-content: space-around;
      align-items: center;
      /* bottom: 200px; */
      /* margin-bottom: 500px; */
    }
    
    .callHeaderTxt {
      font-size: 24px;
      font-weight: normal;
      color: #222222;
    }

    .callBtnWrp {
      flex-direction: row;
      align-items: center;
      width: 468px;
      height: 64px;
      background-color: #c8331c;
      border-radius: 4px;
    }

    .callBtnIcon {
      font-size: 37px;
      color: #ffffff;
      margin-left: 21px;
      margin-right: 21px;
    }

    .callBtnTxt {
      font-size: 30px;
      font-weight: normal;
      color: #ffffff;
    }

    .overlayWrp {
      position: absolute;
      width: 750px;
      /* flex: 1; */
      flex-direction: column;
      justify-content: center;
      align-items: center;
      /* background-color: #000000;
	    opacity: 0.5; */
    }

    .bgWrp {
      width: 750px;
      flex: 1;
      background-color: #000000;
	    opacity: 0.5;
    }

    .callWrp {
      position: absolute;
      width: 546px;
      height: 319px;
      background-color: #ffffff;
      /* opacity: 0.1; */
      border-radius: 5px;
    }

    .page-content {
        width: 750px;
        /* padding-top: 200px; */
        align-items: center;
        /* background-color: #efefef; */
    }

    .welcomeWrp {
      width: 750px;
      height: 98px;
      flex-direction: row;
      justify-content: center;
      align-items: center;
    }

    .welcomeTxt {
      font-size: 30px;
      color: #000000;
    }

    .codeWrp {
      width: 680px;
      height: 248px;
      border-radius: 16px;
      border-style: solid;
      border-width: 1px;
      border-color: #d2d2d2;
      background-color: "#ffffff";
      /* shadow-color: rgba(212, 209, 209, 0.75); */
      /* animation: load 1.1s infinite linear; */
      flex-direction: row;
      justify-content: space-around;
      align-items: center;
    }

    .scanWrp {
      flex-direction: column;
      align-items: center;
    }

    .scanIcon {
      font-size: 110px;
      color: #000000;
    }

    .scanTxt {
      font-size: 30px;
      font-weight: "bold";
	    color: "#222222";
      margin-top: 30px;
    }

    .qrWrp {
      flex-direction: column;
      align-items: center;
    }

    .qrIcon {
      font-size: 110px;
      color: #000000;
    }

    .qrTxt {
      font-size: 30px;
      font-weight: "bold";
	    color: "#222222";
      margin-top: 30px;
    }

    .funWrp {
      width: 750px;
      height: 229px;
      margin-top: 10px;
      flex-direction: row;
      justify-content: space-around;
      align-items: center;
    }

    .eleWrp {
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .funIcon {
      font-size: 98px;
      color: #c8331c;
    }

    .funTxt {
      font-size: 20px;
      color:#000000;
      margin-top: 26px;
    }

    .placeWrp {
      background-color: #efefef;
      width: 750px;
      height: 20px;
      /* border-style: solid;
      border-color: #c8331c;
      border-width: 1px; */
    }

    .rcmWrp {
      width: 750px;
      height: 362px;
    }

    .rcmTitle {
      font-size: 24px;
      color: #666666;
      margin-left: 35px;
      margin-top: 22px;
      margin-bottom: 22px;
    }

     /* @keyframes load {
        0% {
            transform: rotate(0deg);
            border-left-color: rgba(255,255,255,1);
        }
        50% {
            transform: rotate(90deg);
            border-left-color: rgba(255,255,255,.8);
        }
        80% {
            transform: rotate(300deg);
            border-left-color: rgba(255,255,255,.5);
        }
        100% {
            transform: rotate(360deg);
            border-left-color: rgba(255,255,255,1);
        }
    } */

    .slider {
      width: 579px;
      height: 264px;
      background-color: rgb(199, 199, 199);
      align-items: center;
      justify-content: center;
      border-radius: 20px;
    }

    .sliderImg {
      width: 579px;
      height: 264px;
      border-radius: 20px;
      border-style: solid;
      border-width: 1px;
      border-color: #dfdfdf;
      /* background-color: aqua; */
    }

    .sliderTxt {
      position: absolute;
      width: 581px;
      height: 56px;
      background-color: #000000;
      opacity: 0.5;
      font-size: 22px;
      line-height: 56px;
      color: #dddddd;
      text-align: center;
      top: 104px;
    }

    .slider1 {
      /* background-color: #635147; */
    }

    .slider2 {
      /* background-color: #FFC302; */
    }

    .slider3 {
      /* background-color: #FF9090; */
    }

    .slider4 {
      /* background-color: #546E7A; */
    }


    .content-text {
        font-size: 24px;
    }

    .page-navbar {
        width: 750px;
        height: 90px;
        background-color: #ffffff;

    }

    .page-navbar-title {
        /* color: #ffffff; */
        color: #d42e12;
        font-size: 88px;
    }

    .page-content-image {
        width: 480px;
        height: 480px;
        margin-top: 30px;
        margin-bottom: 30px;
    }
</style>
<script>
    import { WxcEpSlider, WxcPanItem, BindEnv, WxcPopup, WxcPopover, WxcOverlay } from 'weex-ui';
    const eeui = app.requireModule('eeui');
    const WxWechatPlugin = app.requireModule('WxWechatPlugin');
    const communication = app.requireModule('communication');
    const modal = weex.requireModule('modal');

    var global = require("../util/global.js");
    global.setEnvironment("en");

    console.log("::::::::::::::::::: ::: " + JSON.stringify(WXEnvironment));
    // module.exports = {
    //   data:{
    //     global:global
    //   }
    // }

    export default {
        props: {
            statusBar: {
                type: [String, Number],
                default: 0
            },
            contentArea: {
              type: [String, Object],
              default: {height: "600px"}
            },
            contentHeight: {
              type: [String, Number],
              default: 1334
            },
        },
        components: { WxcEpSlider,WxcPanItem,WxcPopup,WxcPopover, WxcOverlay },
        data() {
            return {
                global:global,
                title: 'Hello, World!',
                desc: 'Hello, World!  Hello, EEUI! ',
                callCenter1: "",
                callCenter2: "",
                show: false,
                isBottomShow: false,
                sliderId: 1,
                cardLength: 1,
                cardSize: {
                  width: 579,
                  height: 264,
                  spacing: 0,
                  scale: 0.8
                },
                page: 1,
                pageSize: 5,
                toatalCount: 5,
                lists: [{title: 'loading...', introduce: 'loading...'},{title: 'loading...', introduce: 'loading...'}],
                RecommondList: [{pictureUrl: "", title: 'loading...'},{pictureUrl: "", title: 'loading...'}],
                scrollHeight: 800,
                btns: [
                {
                  // icon: 'bmlocal://assets/ewallet/gchart.png',
                  text: 'Customer Service1',
                  key: 'service1'
                },
                {
                  // icon: 'bmlocal://assets/ewallet/acontact.png',
                  text: 'Customer Service2',
                  key: 'service2'
                },
                // {
                //   // icon: 'bmlocal://assets/ewallet/scanqr.png',
                //   text: 'Scan QR Code',
                //   key: 'scan-qr-code'
                // },
                // {
                //   // icon: 'bmlocal://assets/ewallet/collect.png',
                //   text: 'Collect',
                //   key: 'collect'
                // }
              ],
              textStyle: {
                fontSize: 28,
                color: "#c8301c",
                borderBottomColor: "#c8301c"
              },
              popoverPosition: { x: 210, y: 630 },
              popoverArrowPosition: { pos: 'top', x: 160 },
            }
        },

        created() {
          this.reqRecommend();
          this.reqRecommend2();
          this.reqCallCenterNum();
        },

        mounted() {
          this.scrollHeight = this.contentHeight - 683;

          this.$refs.reflectName.setHasMore(true);
            //页面挂载
            // for (let i = 1; i <= 6; i++) {
            //     this.lists.push(i);
            // }
            // this.$refs.reflectName.setHasMore(true);
            // //
            // setTimeout(() => {
            //     this.lists.splice(2, 1, "改变第三项文字")
            //     // splice 详细用法http://www.w3school.com.cn/jsref/jsref_splice.asp
            // }, 1000);
        },

        // beforeCreate: function () {
        //     const domModule = app.requireModule('dom')
        //     domModule.addRule('fontFace', {
        //         'fontFamily': "chinahandfont",
        //         'src': "url('http://at.alicdn.com/t/font_1364538_cin699809qv.ttf')"
        //         // 'src': "url('local://eeui/pages/iconfont/chinahandfont.ttf')"
        //     });
        // },

        methods: {
            /**
             * 生命周期
             * @param res
             */
            lifecycle(res) {
                switch (res.status) {
                    case "ready":
                        //页面挂载(初始化)
                        break;

                    case "resume":
                        //页面激活(恢复)
                        break;

                    case "pause":
                        //页面失活(暂停)
                        break;
                }
            },

            openOverlay () {
              this.show = true;
            },
            wxcOverlayBodyClicked () {
              this.show = false;
            },

            openBottomPopup () {
              this.isBottomShow = true;
            },
            //非状态组件，需要在这里关闭
            popupOverlayBottomClick () {
              this.isBottomShow = false;
            },

            reqCallCenterNum() {
              let vm = this;
              eeui.ajax({
                  method: 'post',
                  url: 'http://ds.paysys.cn/tourismApi/api/platformController/getPlatformInfo',
                  // headers: {
                  //     token: 'x2eefhjb2h3rj'
                  // },
                  dataType: 'json',
                  data: {
                      id: 1
                  },
                  // files: {
                  //     userimg: '/storage/sdcard/.....'
                  // }
              }, function(result) {
                  //......
                  // console.log(" ::::::::::::::aaaaa:::::::::::: "  + JSON.stringify(result));

                  if (result.status === 'success') {
                    if(result.result.retCode == 1){
                      vm.callCenter1 = result.result.data.telephone;
                      vm.callCenter2 = result.result.data.phone;
                    }
                      // console.log(" -------------aaaaa--------------- "  + JSON.stringify(result.result.data));
                    // vm.scheduleList = result.result.data;
                    // vm.RecommondList = result.result.data;
                    // vm.cardLength = result.result.size;
                  }
              });
            },

            reqRecommend() {
              let vm = this;
              eeui.ajax({
                  method: 'post',
                  url: 'http://ds.paysys.cn/tourismApi/api/sceneryController/getTopRecommendScenery',
                  // headers: {
                  //     token: 'x2eefhjb2h3rj'
                  // },
                  dataType: 'json',
                  // data: {
                  //     tripId: 1
                  // },
                  // files: {
                  //     userimg: '/storage/sdcard/.....'
                  // }
              }, function(result) {
                  //......
                  console.log(" :::::::::::::::::::::::::: "  + JSON.stringify(result));
                  if (result.status === 'success') {
                    if(result.result.retCode == 1){
                      // console.log(" -------------tttt--------------- "  + JSON.stringify(result.result));
                      // vm.scheduleList = result.result.data;
                      vm.RecommondList = result.result.data;
                      vm.cardLength = result.result.size;
                      console.log(" ::::::::::::::::::::::::::---------- "  + vm.cardLength);
                    }
                  }
              });
            },

            reqRecommend2() {
              let vm = this;
              eeui.ajax({
                  method: 'post',
                  url: 'http://ds.paysys.cn/tourismApi/api/sceneryController/getSceneryList',
                  // headers: {
                  //     token: 'x2eefhjb2h3rj'
                  // },
                  dataType: 'json',
                  data: {
                      page: vm.page,
                      pageSize: vm.pageSize
                  },
                  // files: {
                  //     userimg: '/storage/sdcard/.....'
                  // }
              }, function(result) {
                  //......
                  // console.log(" :::::::::::::::::::::::::: "  + JSON.stringify(result));
                  if (result.status === 'success') {
                    if(result.result.retCode == 1)
                    // console.log(" -------------tttt--------------- "  + JSON.stringify(result.result));
                    // vm.scheduleList = result.result.data;
                    if(vm.page == 1) {
                      vm.lists = result.result.data;
                      vm.toatalCount = result.result.size;
                    } else {
                      vm.lists.push(...result.result.data);
                    }
                    
                  }
              });
            },
            testss() {
              let vm = this;
              eeui.ajax({
                  method: 'post',
                  url: 'http://39.107.116.47:8082/api/guangdian/cordovaGuangDian!getCategories.do',
                  // headers: {
                  //     token: 'x2eefhjb2h3rj'
                  // },
                  dataType: 'json',
                  body: JSON.stringify({
                    "category":"4408"
                  }),
                  headers: {
                    "Content-Type": "application/json"
                  }
                  // files: {
                  //     userimg: '/storage/sdcard/.....'
                  // }
              }, function(result) {
                  //......
                  // console.log(" :::::::::::::::::::::::::: "  + JSON.stringify(result));
                  // if (result.status === 'success') {
                    
                    console.log(" -------------tttt--------------- "  + JSON.stringify(result.result));
                    // vm.scheduleList = result.result.data;
                    
                    
                  // }
              });
            },

            /**
             * 打开新页面
             * @param jsPageName    (String)JS页面名称
             * @param params        (Object)传递参数
             */
            goForward(jsPageName, params) {
                eeui.openPage({
                    url: str + ".js",
                    pageType: "app",
                    statusBarColor: "#3EB4FF",
                    params: params ? params : {}
                });
            },

            barRightButtonClick () {
              this.$refs['wxc-popover1'].wxcPopoverShow();
            },

            popoverButtonClicked (obj) {
              let vm = this;
              console.log(obj.key)
              if(obj.key == 'service1'){
                vm.phoneCall(vm.callCenter1);
              } else {
                vm.phoneCall(vm.callCenter2);
              }
              // modal.toast({ 'message': `key:${obj.key}, index:${obj.index}`, 'duration': 1 });
            },

            popoverBottomClicked (type) {
              let vm = this;
              // console.log(obj.key)
              if(type == 'service1'){
                vm.phoneCall(vm.callCenter1);
              } else {
                vm.phoneCall(vm.callCenter2);
              }
              vm.isBottomShow = false;
              // modal.toast({ 'message': `key:${obj.key}, index:${obj.index}`, 'duration': 1 });
            },

            // goWechatScan() {
            //   WxWechatPlugin.simple('hello world');
            // },
            goWechat() {
              WxWechatPlugin.goWechatCollect();
            },
            goWechatScan() {
              WxWechatPlugin.goWechatScan();
            },
            goWechatPayCode() {
              WxWechatPlugin.goWechatPayCode();
            },
            goWechatWallet() {
              WxWechatPlugin.goWechatWallet();
            },
            goWechatWalletBalance() {
              WxWechatPlugin.goWechatWalletBalance();
            },
            goWechatBank() {
              WxWechatPlugin.goWechatBank();
            },
            goAlipayScan() {
              WxWechatPlugin.goAliPayScan();
            },
            goAlipayCode() {
              WxWechatPlugin.goAliPayCode();
            },
            phoneCall: function (msg) {
                // window.location.href = 'tel://' + this.tel;
                communication.call(msg);
            },

            /**
             * 返回上一页(关闭当前页)
             */
            goBack() {
                eeui.closePage();
            },
            goSchedule() {
              eeui.openPage({
                pageName: 'Schedule',
                pageType: 'app',
                statusBarStyle: false,
                url: 'schedule/index.js'
              }, function(result) {
                  //......
              });

            },
            goIntroduction(id) {
              console.log("--------------------------- : "  + id);
              eeui.openPage({
                pageName: 'Introduction',
                pageType: 'app',
                statusBarStyle: false,
                url: 'detail/index.js',
                params: {
                  uid: id
                }
              }, function(result) {
                  //......
              });

            },
            viewCode(str) {
                this.openViewCode(str);
            },
            wxcEpSliderCurrentIndexSelected (e) {
              const index = e.currentIndex;
              console.info("================== " + index);
              // @click="goIntroduction(v.uid)"
              // this.goIntroduction(this.RecommondList[index].uid);
            },
            itemClick(params) {
                // eeui.toast("点击了" + (params.position + 1) + "项");
                // eeui.toast("点击了" + (params.position - 1) + "项");
                this.goIntroduction();
            },
            wxcPanItemPan (e) {
              if (BindEnv.supportsEBForAndroid()) {
                // console.log("GTGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG" + JSON.stringify(e));
                // this.$refs['wxc-ep-slider'].clearAutoPlay();
                this.$refs['wxc-ep-slider'].bindExp(e.element)
              }
            },
            wxcPanItemClicked (item) {
              // console.log("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS" + JSON.stringify(item));
              this.goIntroduction(item.uid);
              // this.goIntroduction(this.RecommondList[index].uid);
              // modal.toast({
              //   message: e.extId,
              //   duration: 1
              // })
            },
            pullLoadListener() {

              let vm = this;

              vm.page = vm.page + 1;

              let pageCount = Math.ceil(vm.toatalCount/vm.pageSize);

              console.log("::::::：：：；：：：：：" + vm.toatalCount + "总" + pageCount + "页数" + vm.page );

              if (vm.page <= pageCount) {
                console.log("::::::还有数据：：：；：：：：：");
                setTimeout(() => {                 
                  vm.reqRecommend2();
                  vm.$refs.reflectName.pullloaded();
                }, 1000);
              } else {
                 console.log("::::::没有有数据：：：；：：：：：");
                vm.$refs.reflectName.setHasMore(false);
                return;
              }

                // let count = this.lists.length;
                // if (count >= 18) {
                //     this.$refs.reflectName.setHasMore(false);
                //     return;
                // }
                // setTimeout(() => {
                //     for (let i = 1; i <= 6; i++) {
                //         this.lists.push(count + i);
                //     }
                //     this.$refs.reflectName.pullloaded();
                //     eeui.toast("加载" + (count + 1) + "~" + this.lists.length + "数据成功");
                // }, 1000);

            },
            refreshListener() {
              let vm = this;
              vm.page = 1;
              let newList = [];
              setTimeout(() => {
                  vm.reqRecommend();
                  vm.reqRecommend2();
                  // this.lists = newList;
                  this.$refs.reflectName.setHasMore(true);
                  this.$refs.reflectName.refreshed();
                  // eeui.toast("刷新数据成功");
              }, 1000);
                // let newList = [];
                // for (let i = 1; i <= 6; i++) {
                //     newList.push(i);
                // }
                // setTimeout(() => {
                //     this.lists = newList;
                //     this.$refs.reflectName.setHasMore(true);
                //     this.$refs.reflectName.refreshed();
                //     eeui.toast("刷新数据成功");
                // }, 1000);

            },
        }
    }
</script>
